Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
retext-pos
Advanced tools
Retext POS (part-of-speech) tagger using dariusk/pos-js.
npm:
$ npm install retext-pos
var Retext = require('retext');
var visit = require('retext-visit');
var inspect = require('retext-inspect');
var pos = require('retext-pos');
var retext = new Retext()
.use(visit)
.use(inspect)
.use(pos);
retext.parse(
'I went to the store, to buy 5.2 gallons of milk.',
function (err, tree) {
tree.visit(tree.WORD_NODE, function (node) {
console.log(node);
});
/**
* WordNode[1] [data={"partOfSpeech":"NN"}]
* └─ TextNode: 'I'
*
* WordNode[1] [data={"partOfSpeech":"VBD"}]
* └─ TextNode: 'went'
*
* WordNode[1] [data={"partOfSpeech":"TO"}]
* └─ TextNode: 'to'
*
* WordNode[1] [data={"partOfSpeech":"DT"}]
* └─ TextNode: 'the'
*
* WordNode[1] [data={"partOfSpeech":"NN"}]
* └─ TextNode: 'store'
*
* WordNode[1] [data={"partOfSpeech":"TO"}]
* └─ TextNode: 'to'
*
* WordNode[1] [data={"partOfSpeech":"VB"}]
* └─ TextNode: 'buy'
*
* WordNode[3] [data={"partOfSpeech":"CD"}]
* ├─ TextNode: '5'
* ├─ PunctuationNode: '.'
* └─ TextNode: '2'
*
* WordNode[1] [data={"partOfSpeech":"NNS"}]
* └─ TextNode: 'gallons'
*
* WordNode[1] [data={"partOfSpeech":"IN"}]
* └─ TextNode: 'of'
*
* WordNode[1] [data={"partOfSpeech":"NN"}]
* └─ TextNode: 'milk'
*/
}
);
None, the plugin automatically detects the part-of-speech tag for each WordNode
(using dariusk/pos-js), and stores the tag in node.data.partOfSpeech
.
On a MacBook Air, retext performs about 49% slower with retext-pos.
retext w/o retext-pos
181 op/s » A paragraph (5 sentences, 100 words)
20 op/s » A section (10 paragraphs, 50 sentences, 1,000 words)
retext w/ retext-pos
91 op/s » A paragraph (5 sentences, 100 words)
9 op/s » A section (10 paragraphs, 50 sentences, 1,000 words)
MIT © Titus Wormer
FAQs
retext plugin to add part-of-speech (POS) tags
The npm package retext-pos receives a total of 424 weekly downloads. As such, retext-pos popularity was classified as not popular.
We found that retext-pos demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.